import pandas as pd
import matplotlib.pyplot as plt
from datetime import datetime  # 数据索引改为时间
import numpy as np
import statsmodels.api as sm  # acf,pacf图
from statsmodels.tsa.stattools import adfuller  # adf检验
from pandas.plotting import autocorrelation_plot
from statsmodels.tsa.arima_model import ARIMA

d = [1, 2, 3, 4, 5, 6, 7, 8, 9]
data = pd.Series(np.array(d, dtype=np.float))
data.index = pd.Index(sm.tsa.datetools.dates_from_range('2001', '2009'))
print(data)
diff1 = data.diff(1).dropna()
print(diff1)
model = ARIMA(data, (0, 1, 1)).fit()
# # model.summary2()
# print(model.forecast(5))
